<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>nCov-全国分布图</title>
    <script src="../../static/js/echarts.min.js"></script>
    <script src="../../static/js/china.js"></script>
</head>
<body>
<div id="container" style="width: 800px;height: 600px"></div>
<script>
    // 将图表实例化和容器关联
    var myChart = echarts.init(document.querySelector('#container'));
    var data = {
        a: [120, 132, 101, 134, 90, 230, 210,120, 132, 101, 134, 90, 230, 210,120, 132, 101, 134, 90, 230],
        b: [220, 182, 191, 234, 290, 330, 310,220, 182, 191, 234, 290, 330, 310,220, 182, 191, 234, 290, 330],
        c: [150, 232, 201, 154, 190, 330, 410,150, 232, 201, 154, 190, 330, 410,150, 232, 201, 154, 190, 330],
        d: [320, 332, 301, 334, 390, 330, 320,320, 332, 301, 334, 390, 330, 320,320, 332, 301, 334, 390, 330],
        e: [820, 932, 901, 934, 1290, 1330, 1320,820, 932, 901, 934, 1290, 1330, 1320,820, 932, 901, 934, 1290, 1330]
    };
    var date = ['01-06', '01-06', '01-06', '01-06', '01-06', '01-06', '01-06','01-06','01-06','01-06','01-06','01-06','01-06','01-06','01-06','01-06','01-06','01-06','01-06','01-06',];
    // 配置图表数据信息
    myChart.setOption({
        title: {
            text: '折线图堆叠'
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: date
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name: '邮件营销',
                type: 'line',
                stack: '总量',
                data: data.a
            },
            {
                name: '联盟广告',
                type: 'line',
                stack: '总量',
                data: data.b
            },
            {
                name: '视频广告',
                type: 'line',
                stack: '总量',
                data: data.c
            },
            {
                name: '直接访问',
                type: 'line',
                stack: '总量',
                data: data.d
            },
            {
                name: '搜索引擎',
                type: 'line',
                stack: '总量',
                data: data.e
            }
        ]
    })
</script>
</body>
</html>